﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Org.Eurekaa.DNJ.Settings
{
    [TypeConverter(typeof(ExpandableObjectConverter))]
    [Serializable()]
    public class Interval
    {
        private int minValue;
        [NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public int Min
        {
            get { return minValue; }
            set { minValue = value; }
        }


        private int maxValue;
        [NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public int Max
        {
            get { return maxValue; }
            set { maxValue = value; }
        }

        public Interval(int min, int max)
        {
            Min = min;
            Max = max;
        }

        public override bool Equals(object obj)
        {
            return ((obj as Interval).Min == Min) && ((obj as Interval).Max == Max);            
        }
        public override string ToString()
        {
            return "[" + minValue.ToString() + "," + maxValue.ToString() + "]";
        }
    }
}
